
from libs.exception import BaseHTTPException
from flask_babel import _

class HTTPFunDomainParamError(BaseHTTPException):
    error_code = "fun_domain_param_error"
    description = "Fun Domain Param Error"
    code = 400
    def __init__(self, message: str|None = None):
        if message:
            self.description = message
        super().__init__(self.description)

class HTTPFunNotExistError(BaseHTTPException):
    error_code = "fun_not_exsit_error"
    description = "Fun not exsit error"
    code = 400
    def __init__(self, fun_id: str):
        self.description = _("Fun not exsit error.{fun_id}").format(fun_id=fun_id)
        super().__init__(self.description)

class HTTPFunDomainNotExistError(BaseHTTPException):
    error_code = "fun_domain_not_exsit_error"
    description = "Fun Domain not exsit error"
    code = 400
    def __init__(self, fun_domain_id: str):
        self.description = _("Fun domain not exsit error.{fun_domain_id}").format(fun_domain_id=fun_domain_id)
        super().__init__(self.description)